package org.project.hint_game;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.MalformedURLException;

import android.os.Bundle;
import android.os.Environment;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.view.MotionEvent;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

public class TitleScreenActivity extends Activity {

	private TextView m_startText;
	private int touch_check = 0;

	private String data;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_start_screen);
		this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

		m_startText = (TextView) findViewById(R.id.startText);

		Animation anim = new AlphaAnimation(0.0f, 1.0f);
		anim.setDuration(300); // You can manage the time of the blink with this
								// parameter
		anim.setStartOffset(20);
		anim.setRepeatMode(Animation.REVERSE);
		anim.setRepeatCount(Animation.INFINITE);
		m_startText.startAnimation(anim);
		touch_check = 0;
	}

	public boolean onTouchEvent(MotionEvent event) {
		m_startText.setText("tap registered!!");
		if (touch_check == 0) {
			Intent intent = new Intent(TitleScreenActivity.this, NewJoinActivity.class);
			startActivity(intent);
			touch_check++;
		}
		return true;
	}
	
	@Override
	public void onBackPressed() {
	}
}
